﻿using System.IO;
using System.Windows;
using EfDbLayer;
using WordStat.Tasks;
using CommonLib;
using WordStat.WordExceptions;

namespace WordStat
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        internal FileContainer FileContainer { get; private set; }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //TestNHib();

            DbSingleton.SetDbProvider(EfDbProxy.GetInstance());

            FileContainer = new FileContainer();
            FileContainer.LoadData(Directory.GetCurrentDirectory());
            WordExceptionService.SetDirectory(Directory.GetCurrentDirectory());

            TaskService.InitService(Directory.GetCurrentDirectory());

            _plugInService = new PluginService.PluginService();

            _plugInService.FindPlugins();
        }

        private PluginService.PluginService _plugInService;

        internal PluginService.PluginService PluginSrv
        {
            get { return _plugInService; }
        }
    }
}
